<template>
  <div class="detail">
    <mt-header class="header" fixed>
      <mt-button slot="left" icon="back" @click.native="back">商品详情</mt-button>
      <div class="header-right" slot="right">
        <img src="../assets/imgs/cart/share.png" alt="">
        <mt-button icon="more"></mt-button>
      </div>
    </mt-header>
    <!-- 轮播图 -->
    <mt-swipe :auto="2000" class="swipe">
      <mt-swipe-item><img src="../assets/imgs/index/product_List/400_lg1.jpg" alt=""></mt-swipe-item>
      <mt-swipe-item><img src="../assets/imgs/index/product_List/164_honor_Mate30Pro.jpg" alt=""></mt-swipe-item>
      <mt-swipe-item><img src="../assets/imgs/index/product_List/400_lg1.jpg" alt=""></mt-swipe-item>
    </mt-swipe>
    <!-- 标题价钱 -->
    <div class="item">
      <div class="item-price">
        <span>¥{{phone.price}}</span>
        <img src="../assets/imgs/detail/share.png" alt="">
      </div>
      <h4 class="item-title">{{phone.title}}</h4>
      <p class="item-detail">{{phone.detail}}</p>
    </div>

    <!-- 参数选择 -->
    <div class="select">
      <div class="select-spec">
        <div class="sele-left">选择</div>
        <div class="sele-center">
          <span>机身颜色 / 存储容量</span>
        </div>
        <div class="sele-right"><img src="../assets/imgs/detail/arrow_right.png" alt=""></div>
      </div>

      <div class="select-spec">
        <div class="sele-left">发货</div>
        <div class="sele-center">
          <div>
            <span>广东深圳 </span>|
            <span>快递: 快递包邮</span>
          </div>
          <div class="sele-sales">月销583</div>
        </div>
        <div class="sele-right"><img src="../assets/imgs/detail/arrow_right.png" alt=""></div>
      </div>

      <div class="select-spec">
        <div class="sele-left">保障</div>
        <div class="sele-center">
          <span>7天无理由 · 运费险</span>
        </div>
        <div class="sele-right"><img src="../assets/imgs/detail/arrow_right.png" alt=""></div>
      </div>
      <div class="select-spec">
        <div class="sele-left">活动</div>
        <div class="sele-center">
          <span>暂无活动</span>
        </div>
        <div class="sele-right"><img src="../assets/imgs/detail/arrow_right.png" alt=""></div>
      </div>
      <div class="select-spec">
        <div class="sele-left">参数</div>
        <div class="sele-center">
          <span>网络类型 品牌...</span>
        </div>
        <div class="sele-right"><img src="../assets/imgs/detail/arrow_right.png" alt=""></div>
      </div>
    </div>

    <!-- 底部 -->
    <div class="tabbar">
      <div class="tab-left">
        <div>
          <img src="../assets/imgs/detail/store.png" alt="">
          <p>店铺</p>
        </div>
        <div>
          <img src="../assets/imgs/detail/customer.png" alt="">
          <p>客服</p>
        </div>
        <div>
          <img src="../assets/imgs/detail/collect.png" alt="">
          <p>收藏</p>
        </div>
      </div>
      <div class="tab-right">
        <div>
          <span>加入购物车</span>
        </div>
        <div>
          <span>立即购买</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      phone:{
        id: 1,
        title: "华为 HUAWEI P40 Pro 全网通5G手机 双卡双待 麒麟990",
        detail:'麒麟990 5G SoC芯片 5000万超感知徕卡四摄 50倍数字变焦',
        price: "5988.00",
        imgSrc: "index/product_List/164_honor_Mate30Pro.jpg",
        count: 23,
      },
    };
  },
  methods:{
    back(){
      this.$router.push('/')
    }
  },
};
</script>

<style scoped>
.detail{
  width: 100%;
  background-color: #f8f8f8;
  box-sizing: border-box;
  padding-bottom: 2rem;
  margin-top: 0.8rem;
}
.header{
  padding-right: 0;
}
.header-right{
  line-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}
.swipe {
  width: 100%;
  height: 6rem;
  text-align: center;
  background-color: #fff;
}
.swipe img{
  width: 100%;
}
/* 返回键 */
.back{
  position: fixed;
  top: 0.4rem;
  left: 0.5rem;
  display: block;
  border: 1px solid #e8e8e8;
  width: 0.8rem;
  height: 0.6rem;
  background: url('../assets/imgs/detail/back.png') no-repeat center;
  border-radius: 0.5rem;
}
/* 标题价钱 */
.item{
  margin: 0.2rem;
  background-color: #fff;
  border-radius: 5px;
}
.item-title{
  margin: 0 0.2rem 0.1rem 0.2rem;
  font-size: 0.33rem;
}
.item-detail{
  margin: 0.1rem 0.2rem;
  font-size: 0.28rem;
}
.item-price{
  font-size: 0.5rem;
  color: #f00;
  padding: 0.2rem 0.3rem;
  display: flex;
  justify-content: space-between;
}
/* 选择 */
.select{
  background-color: #fff;
  border-radius: 5px;
  margin: 0.2rem;
  font-size: 0.28rem;
}
.select-spec{
  margin: 0 0.2rem;
  padding: 0.15rem 0;
  display: flex;
}
.sele-left{
  flex-basis: 14%;
  text-align: left;
  color: #999;
}
.sele-center{
  flex-basis: 81%;
  color: #666;
  display: flex;
  justify-content: space-between;
}
.sele-sales{
  color: #999;
}
.sele-right{
  flex-basis: 5%;
}
.tabbar{
  width: 100%;
  color: #666;
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: #fff;
  padding: 0.1rem 0;
}
.tab-left{
  flex-basis: 40%;
  display: flex;
  font-size: 0.24rem;
  justify-content: space-around;
  text-align: center;
  align-items: center;
}
.tab-left p{
  margin: 0;
}
.tab-left div img{
  width: 0.4rem;
}
.tab-right{
  flex-basis: 57%;
  font-size: 0.28rem;
  color: #fff;
  display: flex;
  margin-left: auto;
}
.tab-right div{
  flex-basis: 49%;
  text-align: center;
  background-color: #ff5d36;
  height: 0.7rem;
  line-height: 0.7rem;
  padding: 0 0.2rem;
}
.tab-right div:first-child{
  background-color: #ffa82e;
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
}
.tab-right div:last-child{
  border-bottom-right-radius: 15px;
  border-top-right-radius: 15px;
}
</style>
